<script setup>
import { ref } from 'vue'
import TitleValue from '@components/TitleValue'

const visible = ref(false)
const data = ref()

const open = (value) => {
    data.value = value
    visible.value = true
}

const close = () => {
    visible.value = false
    data.value = {}
}

//把方法暴露给父组件
defineExpose({
    open
})
</script>
    
    <template>
    <el-dialog v-model="visible" title="详情" center @close="close" destroy-on-close :width="500">
        <section v-if="data">
            <title-value title="商户ID" :value="data.id"/>
            <title-value title="商户名称" :value="data.label"/>
            <title-value title="联系人" :value="data.contactName"/>
            <title-value title="手机号" :value="data.phone"/>
            <title-value title="联系地址" :value="data.contactAddress"/>
            <title-value title="印章编号" :value="data.sealNo"/>
            <title-value title="统一社会信用代码" :value="data.orgNumber"/>
        </section>
    </el-dialog>
</template>
    